﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Infrastructure;
using DormMS.Model;
using DormMS.Model.SearchModels;
using DormMS.Model.ViewModels;

namespace DormMS.IService
{
    public interface IMemberService
    {
        #region 会员
        List<V_Member> GetMemberList(MemberSearchModel search, ref int total);
        List<Member> GetMemberInfoList(string where);


        Member GetMemberInfo(int id);
        Member GetMemberInfo(string where);

        V_Member GetV_Member(int id);

        bool EditMember(Member model);

        int AddMember(Member model);
        #endregion

        #region 会员等级
        List<MemberLevel> GetMemberLevelList();

        MemberLevel GetMemberLevelInfo(int id);

        bool EditMemberLevel(MemberLevel model);
        #endregion

        #region 会员地址
        List<MemberAddress> GetMemberAdressList(int memberId);

        List<V_MemberAddress> GetV_MemberAdressList(int memberId);

        List<V_MemberAddress> GetV_MemberAdressList(AddressSearchModel search, ref int total);

        MemberAddress GetMemberAddress(int id);

        V_MemberAddress GetV_MemberAddress(int id);

        /// <summary>
        /// 获取会员默认地址
        /// </summary>
        /// <param name="memberId"></param>
        /// <returns></returns>
        V_MemberAddress GetDefaultAddress(int memberId);

        void AddMemberAddress(MemberAddress model);

        void EditMemberAddress(MemberAddress model);

        void DelMemberAddress(int id);

        #endregion

        #region 会员充值
        List<V_MemberRecharge> GetMemberRechargeList(RechargeSearchModel search, ref int total);
        MemberRecharge GetMemberRecharge(int id);
        int AddMemberRecharge(MemberRecharge model);

        void RechargeSuccess(string payNo);
        #endregion

        #region 会员资金
        List<V_MemberBalanceDetail> GetMemberBalanceDetailList(BaDetailSearchModel search, ref int total);

        /// <summary>
        /// 获取会员的积分记录明细
        /// </summary>
        /// <param name="memberId"></param>
        /// <returns></returns>
        List<MemberBalanceDetail> GetMemberPointDetailList(int memberId);

        List<MemberBalanceDetail> GetMemberMoneyDetailList(int memberId);
        void AddMemberBalanceDetail(MemberBalanceDetail model);
        #endregion

        #region 签到
        int MemberSign(DateTime signDate, int memberId);
        #endregion

        #region 搜索历史
        List<Member_SearchHistory> SearchHistoryList(int Skip, int Take, int currentMemberId, out int total);

        Result AddSearchHistory(int currentMemberId, string keywords);

        Result DelSearchHistory(int currentMemberId);
        #endregion


        /// <summary>
        /// 统计新增会员
        /// </summary>
        /// <returns></returns>
        int GetAddMember();
    }
}
